<?php
namespace app\web\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Scheduling extends Validate
{
    //定义验证规则
    protected $rule = [
        'sort|排序'  => 'require',
        'title|班次名称'  => 'require',
        'start_time|上班时间'  => 'require',
        'end_time|下班时间' =>'require',
        'rest_start_time|休息开始时间' =>'require',
        'rest_end_time|休息结束时间' =>'require',
        'rest_arrange|安排休息技师' =>'require',
        'rule|排位规则' =>'require',
        'late|迟到时间' =>'require',
        'late_rule|迟到规则' =>'require',
    ];
    //定义验证提示
    protected $message = [
        'sort.require' => '排序必须填写',
        'title.require' => '班次必须填写',
        'start_time.require' => '上班时间必须填写',
        'end_time.require' => '下班时间必须填写',
        'rest_start_time.require' => '休息开始时间必须填写',
        'rest_end_time.require' => '休息结束必须填写',
        'rest_arrange.require' => '安排休息技师必须填写',
        'rule.require' => '排位规则必须填写',
        'late.require' => '迟到时间必须填写',
        'late_rule.require' => '迟到规则必须填写',

    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['sort','title','start_time','end_time','rest_start_time','rest_end_time','rest_arrange','rule','late','late_rule'],
    ];
}
